Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.47-pr.425.4dfac63Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.47-pr.425.4dfac63"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.47-pr.425.4dfac63"
}
}
Preview published to npm registry — try new features instantly! |
2f0e68a to
97403bd
Compare
There was a problem hiding this comment.
Maybe logger should be a separate package?
wdyt?
There was a problem hiding this comment.
Love this idea, what do you think about the name @base44-cli/logger? maybe just @base44/logger?
1bd5790 to
2ddd779
Compare
packages/logger/package.json
Outdated
| "version": "0.0.1", | ||
| "description": "Logger interface and implementations for Base44 CLI", | ||
| "type": "module", | ||
| "main": "./src/index.ts", |
There was a problem hiding this comment.
so our tsconfig was set to "moduleResolution": "node" which didn't support "exports", only "main".. working on this
| "ignoreDependencies": ["@types/deno"] | ||
| }, | ||
| "packages/logger": { | ||
| "project": ["src/**/*.ts"] |
There was a problem hiding this comment.
Here you don't need entry?
Why it's needed in packages/cli?
There was a problem hiding this comment.
looked it up, knip recognize the entry by the exports, and since the cli package uses the bin/ folder we need to specify it.. but i removed it for logger package.
knip.json
Outdated
| @@ -7,6 +7,9 @@ | |||
| "project": ["src/**/*.ts", "tests/**/*.ts"], | |||
| "ignore": ["dist/**", "tests/fixtures/**"], | |||
There was a problem hiding this comment.
Do we really need "dist/**" in ignore?
There was a problem hiding this comment.
good catch, removed
# Conflicts: # bun.lock # packages/cli/src/cli/utils/command/Base44Command.ts
| "module": "ES2022", | ||
| "lib": ["ES2022"], | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "bundler", |
There was a problem hiding this comment.
@artemdemo what do you think about this?
this makes it so packag.json will support "exports" and not just "main"
in wix-cli we use "node16", but it seems it raises other issues.. maybe i can first bump to node16 in another branch and then fix this
Note
Description
This PR extracts a
@base44-cli/loggerpackage that provides aLoggerinterface with two implementations:ClackLoggerfor interactive TTY sessions (delegates to@clack/prompts) andSimpleLoggerfor non-interactive/CI environments (writes plain text to stderr). The logger is injected intoCLIContextand passed as the first argument to all action functions viaBase44Command, replacing direct@clack/promptslogimports throughout commands.Related Issue
None
Type of Change
Changes Made
packages/loggerworkspace package (@base44-cli/logger) with aLoggerinterface,ClackLogger(interactive), andSimpleLogger(CI/non-interactive)log: LoggertoCLIContext— instantiated asClackLoggerorSimpleLoggerbased on TTY detection at startup inrunCLI()Base44Command.action()to injectCLIContextas the first argument to every action function, removing the need for commands to access it via the Commander command instanceisNonInteractivegetter fromBase44Command(now accessed via destructured context)ensureAuthandensureAppConfigmiddleware to acceptCLIContextinstead of justErrorReporter{ log }/{ log, isNonInteractive }from the injected context instead of importinglogfrom@clack/promptsdirectlydocs/commands.mdto reflect the new context-injection pattern andLoggerusageLogger,ClackLogger, andSimpleLoggerfrom@/cli/utils/index.jsTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
Loggerinterface maps 1:1 to@clack/promptslog methods (info,success,warn,error,step,message), so migrating commands is mechanical. TheSimpleLoggerwrites all output to stderr to keep stdout clean for machine-readable output in CI pipelines.🤖 Generated by Claude | 2026-03-23 00:00 UTC